<?php
$link = @mysql_pconnect("localhost","lele","happy"); 
mysql_query("SET NAMES 'utf8'");
mysql_select_db("LELE_restaurant");
$dishtype = htmlspecialchars(trim($_POST['dishtype']));
$dishname = htmlspecialchars(trim($_POST['dishname']));
$shortname = htmlspecialchars(trim($_POST['shortname']));
$dishprice = htmlspecialchars(trim($_POST['dishprice']));
$comments = htmlspecialchars(trim($_POST['comments']));
/*
$result = mysql_query("select * from menu");
$row=mysql_fetch_row($result)
if( $shortname == $row['shortname']){
    	echo "success";
}else{
    	echo "failure";
    }
*/	
	$query = "INSERT INTO menu VALUES ('$dishtype','$dishname','$shortname','$dishprice','$comments')";
	mysql_query($query);
//}
mysql_close();
echo "insert $dishtype $dishname $dishprice $comments"
?>
